package com.ulook.lookplanet.data.source;

import com.ulook.lookplanet.common.AppServer;
import com.ulook.lookplanet.util.net.AsynRequestUtil;
import com.ulook.lookplanet.util.net.RequestParams;
import com.ulook.lookplanet.util.net.ResponseCallback;

/**
 * 描述：
 *
 * @author L1998
 * @data 2021/4/21
 */
public class TopicDataSource {

    /**
     * 根据小组id获取帖子
     */
    public void getArticlesForComuId(String uid, int currUserId, int itemNum, ResponseCallback callback){
        RequestParams params = new RequestParams();
        params.put("uid", uid);
        params.put("currUserId", currUserId);
        params.put("itemNum", itemNum);
        AsynRequestUtil.post(AppServer.ROOT_PATH + "/topic/getArticleList", params, null, callback);
    }

    /**
     * 根据话题id获取帖子
     */
    public void getArticlesForTopicId(String uid, int currUserId, int itemNum, ResponseCallback callback){
        RequestParams params = new RequestParams();
        params.put("uid", uid);
        params.put("currUserId", currUserId);
        params.put("itemNum", itemNum);
        params.put("isTopic", "1");
        AsynRequestUtil.post(AppServer.ROOT_PATH + "/topic/getArticleList", params, null, callback);
    }

}
